package com.da.javatest.thread.other;

/**
 * @author chenlida
 * @date 2019/6/26 20:16
 * @description
 */
public class JoinTest {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("main start....");
        Thread t1 = new Thread(JoinTest::common);
        Thread t2 = new Thread(JoinTest::common);
        t1.start();
        t1.join();
        t2.start();
        t2.join();

        System.out.println("main end....");
    }

    private static void common() {
        System.out.println(Thread.currentThread().getName() + " start...");
        try {
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
